package com.hanamaki.oop.demo03;

/**
 * 属性+方法
 */
public class Demo03 {

    String cardType;
    int cardScore;

    // alt + insert


    public Demo03() {
    }

    public Demo03(String cardType, int cardScore) {
        if ((cardType.equals("金卡") && cardScore > 1000) || cardType.equals("普卡") && cardScore > 5000) {
            System.out.println("获得回馈积分500");
            this.cardScore = cardScore + 500;
        }
        this.cardType = cardType;
    }

    @Override
    public String toString() {
        return "Demo03{" +
                "cardType='" + cardType + '\'' +
                ", cardScore=" + cardScore +
                '}';
    }
}
